<html>
<head><meta charset="utf-8"><title>example required feature · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html">example required feature</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221343767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221343767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221343767">(Jan 01 2021 at 09:14)</a>:</h4>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[[example]]</span>
<span class="n">name</span> <span class="o">=</span> <span class="s">"example"</span>
<span class="n">required-features</span> <span class="o">=</span> <span class="k">["a/some_feature"]</span>
</code></pre></div>
<p>this doesn't enable a's some_feature in <code>examples/example.rs</code></p>



<a name="221343965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221343965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221343965">(Jan 01 2021 at 09:20)</a>:</h4>
<p>please help me decide a title for issue</p>



<a name="221344151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344151">(Jan 01 2021 at 09:26)</a>:</h4>
<p><code>required-features</code> doesn't cause features to be enabled. Instead it skips building the respective target when the features are not enabled. <a href="https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field">https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field</a></p>



<a name="221344180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344180">(Jan 01 2021 at 09:27)</a>:</h4>
<p><span class="user-mention" data-user-id="302166">@Manmeet Mann</span> ^</p>



<a name="221344183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344183">(Jan 01 2021 at 09:27)</a>:</h4>
<p>I have also enabled rust-analyzer.cargo.allFeatures  <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="221344226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344226">(Jan 01 2021 at 09:28)</a>:</h4>
<p>so atleast I should not get any errors</p>



<a name="221344230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344230">(Jan 01 2021 at 09:28)</a>:</h4>
<p>That only enables the features of the current crate.</p>



<a name="221344236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344236">(Jan 01 2021 at 09:28)</a>:</h4>
<p>and you got a bit late :( <a href="https://github.com/rust-analyzer/rust-analyzer/issues/7118">https://github.com/rust-analyzer/rust-analyzer/issues/7118</a><br>
but feel free to close</p>



<a name="221344247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344247">(Jan 01 2021 at 09:29)</a>:</h4>
<p>I do feel that something should be done regarding this, like skipping the example</p>



<a name="221344257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/example%20required%20feature/near/221344257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/example.20required.20feature.html#221344257">(Jan 01 2021 at 09:30)</a>:</h4>
<p>Yeah, I guess it can be kept open.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>